home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / Tools Plus 2.5.1 ƒ / Tools Plus 2.5.1 / Tools Plus 2.5.1 for C⁄C++ / ToolsPlus.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-05-29  |  59.8 KB  |  1,214 lines  |  [TEXT/KAHL]

  1. /*  Tools Plus (Version 2.5) THINK C header file
  2.  *  Copyright (C) 1989-1994 Water’s Edge Software
  3.  *
  4.  *  This header file defines all Tools Plus components (constants, variables and
  5.  *    structures).  Programs using Tools Plus must include this header file.
  6.  *
  7.  *    You must include the entire set of Tools Plus libraries and related files in
  8.  *    your project:
  9.  *        ToolsPlus.Lib1
  10.  *        ToolsPlus.Lib2
  11.  *        ToolsPlus.Lib3
  12.  *        ToolsPlus.c
  13.  *        ToolsPlus.h
  14.  */
  15.  
  16.  
  17. #ifndef __ToolsPlus__
  18. #define __ToolsPlus__
  19.  
  20.  
  21. #define        UseColor        true            /* INITIALIZATION: Use color if available        */
  22. #define        IgnoreColor        false            /*                   Don't use color                */
  23. #define        doNothing        0                /* POLLING:    no event                            */
  24. #define        doChgWindow        1                /*            user clicked in an inactive window    */
  25. #define        doRefresh        2                /*            a window has to be refreshed        */
  26. #define        doGoAway        3                /*            the close box was clicked            */
  27. #define        doButton        4                /*            button was clicked                    */
  28. #define        doMenu            5                /*            menu was selected                    */
  29. #define        doKeyDown        6                /*            a keyboard key was pressed            */
  30. #define        doAutoKey        7                /*            a keyboard key is auto-repeating    */
  31. #define        doKeyUp            8                /*            a keyboard key was released            */
  32. #define        doClickField    9                /*            mouse clicked in inactive field        */
  33. #define        doScrollBar        10                /*            mouse clicked in a scroll bar        */
  34. #define        doListBox        11                /*            some sort of List Box activity        */
  35. #define        doClick            12                /*            mouse click/drag [1..3]             */
  36. #define        doPopUpMenu        13                /*            pop-up menu was selected            */
  37. #define        doPictButton    14                /*            picture button activity                */
  38. #define        doClickControl    101                /*            mouse clicked in a custom control    */
  39. #define        doManualEvent    102                /*            manually processed events            */
  40. #define        doMoveWindow    103                /*            a window was dragged by user        */
  41. #define        doGrowWindow    104                /*            a window was "grown" by user        */
  42. #define        doClickDesk        105                /*            mouse clicked in the desk top        */
  43. #define        doZoomWindow    106                /*            zoom box was clicked by user        */
  44. #define        doSuspend        107                /*            appl. suspended (in background)        */
  45. #define        doResume        108                /*            appl. resumed (now active appl.)    */
  46. #define        inClick1        1                /* CLICK:    mouse single-click completed        */
  47. #define        inClick2        2                /*            mouse double-click completed        */
  48. #define        inClick3        3                /*            mouse triple-click completed        */
  49. #define        inClick1Drag    -1                /*            mouse single-click, still dragging    */
  50. #define        inClick2Drag    -2                /*            mouse double-click, still dragging    */
  51. #define        inClick3Drag    -3                /*            mouse triple-click, still dragging    */
  52. #define        EnterKey        (char)0x03        /* KEYS:    Key characters (ASCII) for the most    */
  53. #define        BackSpaceKey    (char)0x08        /*              commonly encountered keys.  In    */
  54. #define        TabKey            (char)0x09        /*              some cases, several keys produce    */
  55. #define        ReturnKey        (char)0x0D        /*              the same ASCII character.  They    */
  56. #define        EscClearKey        (char)0x1B        /* (0x1B)      may be differentiated by using    */
  57. #define        LeftArrowKey    (char)0x1C        /*               the key code, as indicated below.    */
  58. #define        RightArrowKey    (char)0x1D        /*              Some keys are available only on    */
  59. #define        UpArrowKey        (char)0x1E        /*              an "extended" keyboard.            */
  60. #define        DownArrowKey    (char)0x1F        /*                                                */
  61. #define        HelpKey            (char)0x05        /*                                                */
  62. #define        HomeKey            (char)0x01        /*                                                */
  63. #define        DeleteFwdKey    (char)0x7F        /*                                                */
  64. #define        EndKey            (char)0x04        /*                                                */
  65. #define        PageUpKey        (char)0x0B        /*                                                */
  66. #define        PageDownKey        (char)0x0C        /*                                                */
  67. #define        FKey            (char)0x10        /* (0x10)    Function keys "F1" to "F15"            */
  68. #define        EscKeyCode        0x35            /* (0x1B)    KEY CODES used to differentiate        */
  69. #define        ClearKeyCode    0x47            /* (0x1B)      between keys which produce the    */
  70. #define        F1KeyCode        0x7A            /* (0x10)      same key characters.                */
  71. #define        F2KeyCode        0x78            /*                                                */
  72. #define        F3KeyCode        0x63            /*                                                */
  73. #define        F4KeyCode        0x76            /*                                                */
  74. #define        F5KeyCode        0x60            /*                                                */
  75. #define        F6KeyCode        0x61            /*                                                */
  76. #define        F7KeyCode        0x62            /*                                                */
  77. #define        F8KeyCode        0x64            /*                                                */
  78. #define        F9KeyCode        0x65            /*                                                */
  79. #define        F10KeyCode        0x6D            /*                                                */
  80. #define        F11KeyCode        0x67            /*                                                */
  81. #define        F12KeyCode        0x6F            /*                                                */
  82. #define        F13KeyCode        0x69            /*                                                */
  83. #define        F14KeyCode        0x6B            /*                                                */
  84. #define        F15KeyCode        0x71            /*                                                */
  85. #define        mDividingLine    "\p-"            /* MENUS:    Dividing line                        */
  86. #define        AppleChar        (char)0x14        /* MENU CHARS:    Apple character                    */
  87. #define        CheckChar        (char)0x12        /*                Check Mark character            */
  88. #define        DiamondChar        (char)0x13        /*                Diamond character                */
  89. #define        DotChar            (char)0xA5        /*                Dot (or bullet) character        */
  90. #define        NoChar            (char)0x00        /*                no character                    */
  91.                                             /* PICTURE BUTTONS:                                */
  92. #define        picbutInstantEvent      0x80000000/*        Report event on mouse-down                */
  93. #define        picbutTrackWithHilite 0x40000000/*        Track using hiliting, like radio button    */
  94. #define        picbutLockSelected      0x20000000/*        Lock if selected (mouse can't deselect)    */
  95. #define        picbutSwitchSelected  0x10000000/*        Switch 'selected' state if clicked        */
  96. #define        picbutRepeatEvents      0x08000000/*        Repeat event when button is held down    */
  97. #define        picbutAutoValueChg      0x04000000/*        Automatically change button's value        */
  98. #define        picbutScaleLinear      0x00000000/*        Rate of automatic value change…            */
  99. #define        picbutScaleSlowAccel  0x01000000/*            Linear, Slow Acceleration,            */
  100. #define        picbutScaleMedAccel      0x02000000/*            Medium Acceleration, and            */
  101. #define        picbutScaleFastAccel  0x03000000/*            Fast Acceleration.                    */
  102. #define        picbutLinear          0x0        /*            Linear (use in structure)            */
  103. #define        picbutSlowAccel          0x1        /*            Slow (use in structure)                */
  104. #define        picbutMedAccel          0x2        /*            Medium (use in structure)            */
  105. #define        picbutFastAccel          0x3        /*            Fast (use in structure)                */
  106. #define        picbutValueWrap          0x00800000/*        Button's range of values 'wrap' around    */
  107. #define        picbutLeftRightSplit  0x00400000/*        Left side reduces value, right increases*/
  108. #define        picbutTopBottomSplit  0x00200000/*        Top increases value, bottom reduces        */
  109. #define        picbutMultiStage      0x00100000/*        Button has multiple stages                */
  110. #define        picbutBigSICN3D          0x00080000/*        Create a larger SICN 3D button            */
  111. #define        picbutUsePICTS          0x00040000/*        Use PICTs instead of icons                */
  112. #define        picbutGray4use8          0x00020000/*        Use 8-bit color pict on 4-bit gray CRT    */
  113.                                             /*      Selection Effects…                        */
  114. #define        picbutSelectDarken      0x00010000/*        Darken image                            */
  115. #define        picbutSelectDarkenSICN3D  0x00008000/*    Darken (and push in) a 3D SICN icon        */
  116. #define        picbutSelectLightenSICN3D 0x00004000/*    Lighten (and push in) a 3D SICN icon    */
  117. #define        picbutSelectPushedSICN3D  0x00002000/*    Same color (and push in) a 3D SICN icon    */
  118. #define        picbutSelectAltImage      0x00000400/*    Use an alternate image                    */
  119.                                                 /*Disabling Effects…                        */
  120. #define        picbutDimUsingBlackLite      0x00000100/*    Overlay Black color using Lt Gray pat.    */
  121. #define        picbutDimUsingWhiteLite      0x00000080/*    Overlay White color using Lt Gray pat.    */
  122. #define        picbutDimUsingWhite          0x00000040/*    Overlay White color using Gray pat.        */
  123. #define        picbutDimLeaveBorder      0x00000008/*    Leave border when applying effect        */
  124. #define        picbutDimAltImage        0x00000004    /*    Use an alternate image                    */
  125. #define        picbutDimNoChange        0x00000002    /*    Button looks the same when disabled        */
  126.                                             /* POP-UP MENUS:                                */
  127. #define        popupNeverDimOutline    0x0100    /*        Never dim the control's outline?        */
  128. #define        popupNeverDimSelection    0x0080    /*        Never dim the selected item's text?        */
  129. #define        popupNeverDimTitle        0x0040    /*        Never dim the title?                    */
  130. #define        popupNoArrow            0x0020    /*        Is the "down arrow" hidden?                */
  131. #define        popupMultiSelect        0x0010    /*        Allow multiple items to be selected?    */
  132. #define        popupUseWFont            0x0008    /*        Use the window's font for the menu?        */
  133. #define        popupIconTitle            0x0004    /*        Draw icon in the control's title?        */
  134. #define        popupFixedTitle            0x0002    /*        Is fixed title displayed in the control?*/
  135. #define     popupDefaultType        0x0000    /*        Default menu (sys font, 1 item, no icon)*/
  136. #define        arrowCursor        0                /* CURSORS:    "arrow" cursor                        */
  137. #define        GoAway            true            /* WINDOWS:    no "close box"                        */
  138. #define        NoGoAway        false            /*            window has a "close box"            */
  139. #define        Modal            true            /*            window is "modal"                    */
  140. #define        NotModal        false            /*            window is not "modal                */
  141. #define        ZoomBox            8                /*            zoom box added to ProcID            */
  142. #define        paletteProc        32004            /*            Floating Palette window                */
  143. #define        altPaletteProc    32006            /*            Floating Palette, drag bar on left    */
  144. #define        ordPaletteProc    32000            /*            Window that looks like a palette    */
  145. #define        wNoKind            0                /*        Kinds of Windows:    Not open            */
  146. #define        wToolBarKind    1                /*                            Tool Bar            */
  147. #define        wFloatingKind    2                /*                            Floating Palette    */
  148. #define        wStandardKind    3                /*                            Standard Window        */
  149. #define        wAnimateMove        0x01        /*      Moving Windows:    Animate w/Zoom Lines    */
  150. #define        wOffsetForToolBar    0x02        /*                        Offset co-ords for TB    */
  151. #define        wShow                true        /*        Hiding Windows:    Display (unhide)        */
  152. #define        wHide                false        /*                        Hide window                */
  153. #define        tbShiftWindows        0x01        /*TOOL BAR:    Shift windows when TB opens            */
  154. #define        tbOffsetNewWindows    0x02        /*            Offset new windows as they are        */
  155.                                             /*                opened (if Tool Bar is open).    */
  156. #define        DefaultButton    4                /* BUTTONS:    "default" for the window            */
  157. #define        selected        true            /*            button is selected (ie: checked)    */
  158. #define        notSelected        false            /*            button is not selected                */
  159. #define        scrlLeftEdge    -1                /* SCROLL BARS:    left edge of document            */
  160. #define        scrlTopEdge        -1                /*                top edge of document            */
  161. #define        scrlRightEdge    32767            /*                right edge of document            */
  162. #define        scrlBottomEdge    32767            /*                bottom edge of document            */
  163.                                             /* BUTTONS, MENUS, SCROLL BARS & ICONS:            */
  164. #define        enabled            true            /*            enabled (active)                    */
  165. #define        disabled        false            /*            disabled (dim, inactive)            */
  166. #define        teBoxNoCR        0                /* EDIT FIELDS:    box around field, no CR allowed    */
  167. #define        teBoxCR            1                /*                box around field, CR allowed    */
  168. #define        teNoBoxNoCR        2                /*                no box, no CR allowed            */
  169. #define        teNoBoxCR        3                /*                no box, CR allowed                */
  170. #define        teSelectAll        0                /* EDIT FIELD SELECTION: all of text            */
  171. #define        teSelectStart    1                /*                         beginning of text        */
  172. #define        teSelectEnd        2                /*                         end of text            */
  173. #define        teReplace        true            /* PASTE INTO FIELD: replace field contents        */
  174. #define        teInsert        false            /*                     insert text into field        */
  175. #define        OkAltBut        1                /* ALERTS:    OK                (Buttons)            */
  176. #define        CanAltBut        2                /*            Cancel                                */
  177. #define        YesAltBut        3                /*            Yes                                    */
  178. #define        NoAltBut        4                /*            No                                    */
  179. #define        ContAltBut        5                /*            Continue                            */
  180. #define        SkipAltBut        6                /*            Skip                                */
  181. #define        QuitAltBut        7                /*            Quit                                */
  182. #define        NoButtonAlert    0                /*            No buttons        (Combinations)        */
  183. #define        OkAlert            11100            /*            OK (default)                        */
  184. #define        CanAlert        11200            /*            Cancel (default)                    */
  185. #define        OkCanAlert        22210            /*            OK (default) + Cancel                */
  186. #define        CanOkAlert        21210            /*            OK + Cancel (default)                */
  187. #define        YesNoAlert        22430            /*            Yes (default) + No                    */
  188. #define        NoYesAlert        21430            /*            Yes + No (default)                     */
  189. #define        YesNoCanAlert    33243            /*            Yes (default) + No + Cancel            */
  190. #define        NoYesCanAlert    32243            /*            Yes + No (default) + Cancel            */
  191. #define        nmSysBeep        -1                /* NOTIFICATION: Use System Error sound            */
  192. #define        nmSilentNote    0                /*                 Silent notification            */
  193. #define        nmDefaultMsg    "\p "            /*                 Use default message            */
  194. #define        nmNoMsg            "\p"            /*                 Don't display an alert            */
  195. #define        nmResetWhenDone    true            /*                 Reset to defaults after used    */
  196. #define        nmKeepSettings    false            /*                 Keep settings after used        */
  197. #define        NoIcon            -32768            /* ICONS:    No icon used                        */
  198.                                             /*        Disabled icons' default appearance…        */
  199. #define        DfltIconDimBlackLtPat 0x01        /*        Overlay Black color w/ Lt Gray pattern    */
  200. #define        DfltIconDimWhiteLtPat 0x02        /*        Overlay White color w/ Lt Gray pattern    */
  201. #define        DfltIconDimWhitePat      0x04        /*        Overlay White color w/ Gray pattern        */
  202. #define        DfltIconLeaveBorder      0x20        /*      Leave border when selected or disabled    */
  203. #define        DfltIconUpdateNow   0x8000        /*      Update all windows with changes            */
  204. #define        on                true            /* MISCELLANEOUS:                                */
  205. #define        off                false            /*                                                */
  206. #define        maxNullTime        0x7FFFFFFF        /*            Infinite time between doNothing evts*/
  207. #define        ZoomAcross        0                /* ZOOM LINES: transitional                        */
  208. #define        ZoomIn            -1                /*               zoom inward (further away)        */
  209. #define        ZoomOut            1                /*               zoom outward (nearer)            */
  210. #define        none            0                /* used primarily for polling                    */
  211.  
  212.  
  213.  
  214.  
  215.  
  216. /* - - - - - - These record "types" are used for information transfer between - - - - - - -    */
  217. /*                         your application and Tools Plus libraries.                            */
  218.  
  219. /*= Polling record's "event modifiers" info*/
  220.   union TPModifiersRec {                    /*This variable record contains an event's        */
  221.                                             /*    "modifiers" in 2 formats…                    */
  222.                                             /*    • Macintosh Event:                            */
  223.         short Num;                            /*        short (bit operations required)            */
  224.         struct {                            /*    • Modifier short parsed into components:    */
  225.             unsigned short bit15 :1;        /*        (reserved bit)                            */
  226.             unsigned short bit14 :1;        /*        (reserved bit)                            */
  227.             unsigned short bit13 :1;        /*        (reserved bit)                            */
  228.             unsigned short ControlKey :1;    /*        Control key was down at event (=1)        */
  229.             unsigned short OptionKey :1;    /*        Option key was down at event (=1)        */
  230.             unsigned short CapsLock :1;        /*        Caps Lock was down at event (=1)        */
  231.             unsigned short ShiftKey :1;        /*        Shift key was down at event (=1)        */
  232.             unsigned short CmdKey :1;        /*        Command key was down at event (=1)        */
  233.             unsigned short MouseUp :1;        /*        Mouse button was UP at event (=1)        */
  234.             unsigned short bit6 :1;            /*        (reserved bit)                            */
  235.             unsigned short bit5 :1;            /*        (reserved bit)                            */
  236.             unsigned short bit4 :1;            /*        (reserved bit)                            */
  237.             unsigned short bit3 :1;            /*        (reserved bit)                            */
  238.             unsigned short bit2 :1;            /*        (reserved bit)                            */
  239.             unsigned short bit1 :1;            /*        (reserved bit)                            */
  240.             unsigned short bit0 :1;            /*        (reserved bit)                            */
  241.         } Bits;                                /*                                                */
  242.     };
  243.     typedef union TPModifiersRec TPModifiersRec;
  244. /*= Polling record's "button" info*/
  245.       struct TPPollButtonRec {
  246.         short Num;                            /*Button number                                    */
  247.         Boolean DoubleClick;                /*Did a double-click occur?                        */
  248.     };
  249.     typedef struct TPPollButtonRec TPPollButtonRec;
  250. /*= Polling record's "scroll bar" info*/
  251.       struct TPPollScrollBarRec {
  252.         short Num;                            /*Scroll bar number                                */
  253.         short Part;                            /*Scroll bar's part                                */
  254.     };
  255.     typedef struct TPPollScrollBarRec TPPollScrollBarRec;
  256. /*= Polling record's "list box" info*/
  257.     struct TPPollListBoxRec {
  258.         short Num;                            /*List box number                                */
  259.         Boolean DoubleClick;                /*Did a double-click occur?                        */
  260.     };
  261.     typedef struct TPPollListBoxRec TPPollListBoxRec;
  262. /*= Polling record's "menu" info*/
  263.     struct TPPollMenuRec {
  264.         short Num;                            /*Menu number                                    */
  265.         short Item;                            /*Menu item number                                */
  266.     };
  267.     typedef struct TPPollMenuRec TPPollMenuRec;
  268. /*= Polling record's "key-stroke" info*/
  269.     struct TPPollKeyRec {
  270.         short Code;                            /*Logical key number of the typed key            */
  271.         char Chr;                            /*ASCII character generated by typed key        */
  272.         Byte Unused;                        /* (reserved byte)                                */                
  273.     };
  274.     typedef struct TPPollKeyRec TPPollKeyRec;
  275. /*= Polling record's "mouse location and time" info for mouse-down and mouse-up events*/
  276.     struct TPPollMousePointRec {
  277.         Point Where;                        /*Event location in local co-ordinates            */
  278.         long When;                            /*Event time in clock ticks from boot (1/60 sec)*/
  279.         TPModifiersRec Modifiers;            /*Event modifiers                                */
  280.     };
  281.     typedef struct TPPollMousePointRec TPPollMousePointRec;
  282. /*= Polling record's "mouse click/drag" info*/
  283.     struct TPPollMouseRec {
  284.         short What;                            /*What type of mouse event? (click or drag)        */
  285.         TPPollMousePointRec Down[3];        /*Where & when did the mouse-down occur            */
  286.         TPPollMousePointRec Up[3];            /*Where & when did the mouse-up occur            */
  287.         Point Where;                        /*Current mouse location in local co-ordinates    */
  288.     };
  289.     typedef struct TPPollMouseRec TPPollMouseRec;
  290. /*= POLLING record for Tools Plus*/
  291.     struct TPPollRecord {                    /*Tools Plus Polling record…                    */
  292.         short What;                            /*What type of event has occurred?                */
  293.         short Window;                        /*Window number of the event                    */
  294.         TPPollButtonRec Button;                /*Button number/double-click status                */
  295.         TPPollScrollBarRec ScrollBar;        /*Scroll bar number/scroll bar part                */
  296.         short Field;                        /*Field number of event                            */
  297.         TPPollListBoxRec ListBox;            /*List box number/double-click status            */
  298.         TPPollMenuRec Menu;                    /*Menu number/menu item of an event                */
  299.         TPPollKeyRec Key;                    /*Logical key number & character of typed key    */
  300.         TPPollMouseRec Mouse;                /*Click/drag info: [1..3] where & when            */
  301.         TPModifiersRec Modifiers;            /*Modifier flags                                */
  302.         EventRecord Event;                    /*Macintosh Toolbox Event (raw)                    */
  303.     };
  304.     typedef struct TPPollRecord TPPollRecord;
  305.     typedef TPPollRecord *TPPollPointer;    /*Pointer to a Polling record                    */
  306.  
  307.  
  308. /*= WINDOW status information*/
  309.     struct TPWindowStatus {
  310.         short Kind;                            /*Window kind: Tool Bar, Palette, or Standard    */
  311.         Boolean Open;                        /*Is the window open?                            */
  312.         Boolean Visible;                    /*Is this window visible (not hidden)?            */
  313.         Boolean Active;                        /*Is this window active?                        */
  314.         Boolean Front;                        /*Is this the frontmost Tools Plus window?        */
  315.         Boolean Current;                    /*Is this the current window?                    */
  316.         Boolean WorkWindow;                    /*Is this the work window?                        */
  317.         Boolean EditFieldWindow;            /*Does this window have app's active field?        */
  318.         short ActiveField;                    /*Window's active field number                    */
  319.         Rect StrucRect;                        /*Structure rect (global). Incl border&title bar*/
  320.         Rect ContRect;                        /*Content rect (global).  Working area only.    */
  321.     };
  322.     typedef struct TPWindowStatus TPWindowStatus;
  323.  
  324.  
  325. /*= Color Pen information*/
  326.     struct ColorPenState {                    /*Color equivalent for a 'PenState' record.        */
  327.         PenState PenState;                    /*    This record also stores additional values    */
  328.         RGBColor ForegroundColor;            /*    for the window's foreground and background    */
  329.         RGBColor BackgroundColor;            /*    colors.                                        */
  330.     };
  331.     typedef struct ColorPenState ColorPenState;
  332.  
  333.  
  334. /*= Picture Button Appearance & Behavior Specification (or you can use constants instead)    */
  335.     union TPPictButtonSpec {                        /*Picture Button's appearance and        */
  336.                                                     /*    behavior specs in 2 formats…        */
  337.         struct{                                        /* • Parsed into components:            */
  338.             unsigned short InstantEvent: 1;            /*        Report event on mouse-down        */
  339.             unsigned short TrackWithHilite: 1;        /*        Track using hiliting (like a    */
  340.                                                     /*            radio button)                */
  341.             unsigned short LockSelected: 1;            /*        Lock if selected (mouse can't    */
  342.                                                     /*            deselect)                    */
  343.             unsigned short SwitchSelected: 1;        /*        Switch 'select' state if clicked*/
  344.             unsigned short RepeatEvents: 1;            /*        Repeat event when button is held*/
  345.             unsigned short AutoValueChg: 1;            /*        Automatically chg button's value*/
  346.             unsigned short AutoValueScaling: 3;        /*        Rate of chg for button's value    */
  347.             unsigned short ValueWrap: 1;            /*        Button's range of values 'wrap'    */
  348.                                                     /*            around.                        */
  349.             unsigned short LeftRightSplit: 1;        /*        Left side reduces value, right    */
  350.                                                     /*            increases.                    */
  351.             unsigned short TopBottomSplit: 1;        /*        Top increases value, bottom        */
  352.                                                     /*            reduces.                    */
  353.             unsigned short MultiStage: 1;            /*        Button has multiple stages        */
  354.             unsigned short BigSICN3D: 1;            /*        Create a larger SICN 3D button    */
  355.             unsigned short UsePICTS: 1;                /*        Use PICTs instead of icons        */
  356.             unsigned short Gray4use8: 1;            /*        Use 8-bit color pict on 4-bit    */
  357.                                                     /*            gray monitor.                */
  358.                                                     /*    Selection Effects…                    */
  359.             unsigned short SelectDarken: 1;            /*        Darken image                    */
  360.             unsigned short SelectDarkenSICN3D: 1;    /*        Darken (+push in) a 3D SICN icon*/
  361.             unsigned short SelectLightenSICN3D: 1;    /*        Lighten (+push in) 3D SICN icon    */
  362.             unsigned short SelectPushedSICN3D: 1;    /*        Same color (+push) 3D SICN icon    */
  363.             unsigned short bit19: 1;                /*           (reserved bit)                */
  364.             unsigned short bit20: 1;                /*           (reserved bit)                */
  365.             unsigned short SelectAltImage: 1;        /*        Use an alternate image            */
  366.             unsigned short bit22: 1;                /*           (reserved bit)                */
  367.                                                     /*   Disabling Effects…                    */
  368.             unsigned short DimUsingBlackLite: 1;    /*        Overlay Black color, Lt Gray pat*/
  369.             unsigned short DimUsingWhiteLite: 1;    /*        Overlay White color, Lt Gray pat*/
  370.             unsigned short DimUsingWhite: 1;        /*        Overlay White color, Gray pat.    */
  371.             unsigned short bit26: 1;                /*           (reserved bit)                */
  372.             unsigned short bit27: 1;                /*           (reserved bit)                */
  373.             unsigned short DimLeaveBorder: 1;        /*        Leave border when effect applied*/
  374.             unsigned short DimAltImage: 1;            /*        Use an alternate image            */
  375.             unsigned short DimNoChange: 1;            /*        Button looks same when disabled    */
  376.             unsigned short bit31: 1;                /*           (reserved bit)                */
  377.         } Bits;                                        /*                                        */
  378.         long Num;                                    /* • Long equivalent                    */
  379.     };                                                /*                                        */
  380.     typedef union TPPictButtonSpec TPPictButtonSpec;
  381.  
  382.  
  383. /*= Pop-Up Menu Appearance & Behavior Specification (or you can use constants instead)        */
  384.     union TPPopUpMenuSpec {                            /*Pop-Up Menu's appearance and behavior    */
  385.                                                     /*    specifications in 2 formats…        */
  386.         struct{                                        /* • Parsed into components:            */
  387.             unsigned short bit15 :1;                /*        (reserved bit)                    */
  388.             unsigned short bit14 :1;                /*        (reserved bit)                    */
  389.             unsigned short bit13 :1;                /*        (reserved bit)                    */
  390.             unsigned short bit12 :1;                /*        (reserved bit)                    */
  391.             unsigned short bit11 :1;                /*        (reserved bit)                    */
  392.             unsigned short bit10 :1;                /*        (reserved bit)                    */
  393.             unsigned short bit9 :1;                    /*        (reserved bit)                    */
  394.             unsigned short NeverDimOutline :1;        /*     Never dim the control's outline?    */
  395.             unsigned short NeverDimSelectedItem: 1;    /*     Never dim the selected item's text?*/
  396.             unsigned short NeverDimTitle: 1;        /*     Never dim the title?                */
  397.             unsigned short NoArrow: 1;                /*     Is the "down arrow" hidden?        */
  398.             unsigned short MultipleSelections: 1;    /*     Allow multiple items to be selected*/
  399.             unsigned short useWFont: 1;                /*     Display using window's font?        */
  400.             unsigned short IconInTitle: 1;            /*     Draw icon in the control's title?    */
  401.             unsigned short FixedTitle: 1;            /*     Display fixed title in the control?*/
  402.             unsigned short bit0 :1;                    /*        (reserved bit)                    */
  403.         } Bits;                                        /*                                        */
  404.         short Num;                                    /* • Short equivalent                    */
  405.     };                                                /*                                        */
  406.     typedef union TPPopUpMenuSpec TPPopUpMenuSpec;
  407.  
  408.  
  409.  
  410.  
  411.  
  412. #ifdef __cplusplus
  413. extern "C" {
  414. #endif
  415.  
  416. /*======================================== I N I T I A L I Z A T I O N ========================================    */
  417. /*Initialize Tools Plus*/
  418.     pascal Boolean InitToolsPlus (short MoreHandles,            /*Number of MoreMasters initializing cycles        */
  419.                                     short MaxWindows,            /*Maximum number of windows required            */
  420.                                     Boolean UseColorFlag         /*Should Color QuickDraw be used if available?    */
  421.                                     );                            /* = Was initialization successful?                */
  422.  
  423.  
  424.  
  425. /*=============================================== W I N D O W S ===============================================    */
  426. /*Open a window and make it current*/
  427.     pascal void WindowOpen (short Window,                        /*Window number                                    */
  428.                                     short left,                    /*Window's co-ordinates (global)                */
  429.                                     short top,                    /*                                                */
  430.                                     short right,                /*                                                */
  431.                                     short bottom,                /*                                                */
  432.                                     Str255 Title,                /*Window's title (if applicable)                */
  433.                                     short procID,                /*Window definition ID                            */
  434.                                     Boolean goAwayFlag,            /*Include Close Box?                            */
  435.                                     Boolean modalFlag);            /*Is window modal?                                */
  436.  
  437. /*Open a window and make it current (co-ordinates specified as a 'rect') */
  438.     pascal void WindowOpenRect (short Window,                    /*Window number                                    */
  439.                                     Rect *Bounds,                /*Window's co-ordinates (global)                */
  440.                                     Str255 Title,                /*Window's title (if applicable)                */
  441.                                     short procID,                /*Window definition ID                            */
  442.                                     Boolean goAwayFlag,            /*Include Close Box?                            */
  443.                                     Boolean modalFlag);            /*Is window modal?                                */
  444.  
  445. /*Open the tool bar and make it current*/
  446.     pascal void ToolBarOpen (short Window,                        /*Window number                                    */
  447.                                     short Height,                /*Tool bar height                                */
  448.                                     short procID);                /*Appearance/behavior specifications            */
  449.  
  450. /*Close a window*/
  451.     pascal void WindowClose (short Window);                        /*Window number                                    */
  452.  
  453. /*Change a window's size*/
  454.     pascal void WindowSize (short Window,                        /*Window number                                    */
  455.                                     short Width,                /*Window's new width                            */                    
  456.                                     short Height,                /*Window's new height                            */
  457.                                     Boolean Update);            /*Force doRefresh event for newly exposed rgn?    */
  458.  
  459. /*Move a window to the specified co-ordinates*/
  460.     pascal void WindowMove (short Window,                        /*Window number                                    */
  461.                                     short hGlobal,                /*Horizontal co-ordinates (global)                */
  462.                                     short vGlobal,                /*Vertical co-ordinates (global)                */
  463.                                     short procID);                /*Behavior specifications                        */
  464.  
  465. /*Hide or show a window*/
  466.     pascal void WindowDisplay (short Window,                    /*Window number                                    */
  467.                                     Boolean Show);                /*Should the window be shown?                    */
  468.  
  469. /*Make a specified window the "active" and "current" window*/
  470.     pascal void ActivateWindow (short Window);                    /*Window number                                    */
  471.  
  472. /*Set a window's title*/
  473.     pascal void WindowTitle (short Window,                        /*Window number                                    */
  474.                                     Str255 Title);                /*Window's title (if applicable)                */
  475.  
  476. /*Set the current window's "growing" limits (ie: maximum/minimum size) */
  477.     pascal void SetWindowSizeLimits (short minHoriz,            /*Window's size limits in pixels                */
  478.                                     short minVert,                /*                                                */
  479.                                     short maxHoriz,                /*                                                */
  480.                                     short MaxVert);                /*                                                */
  481.  
  482. /*Set the current window's standard co-ordinates and user co-ordinates for "zooming"*/
  483.     pascal void SetWindowZoom (Rect *userRect, Rect *stdRect);    /*User & standard co-ordinates (global)            */
  484.  
  485. /*Get the current window's user co-ordinates & standard co-ordinates for "zooming"*/
  486.     pascal void GetWindowZoom (Rect *userRect, Rect *stdRect);    /*User & standard co-ordinates (global)            */
  487.  
  488. /*Make a specified window "current", but do not activate it*/
  489.     pascal void CurrentWindow (short Window);                    /*Window number                                    */
  490.  
  491. /*Make the "active" window the "current"*/
  492.     pascal void CurrentWindowReset(void);
  493.  
  494. /*Get a window's status*/
  495.     pascal void WindowStatus (short Window,                        /*Window number                                    */
  496.                                     TPWindowStatus *Status);    /*Window's status record                        */
  497.  
  498. /*Get the active window number (last used window if Tool Bar and/or Floating Palettes are open)    */
  499.     pascal short ActiveWindowNumber(void);                        /*Window number of active window                */
  500.  
  501. /*Get the current window number*/
  502.     pascal short CurrentWindowNumber(void);                        /*Window number of current window                */
  503.  
  504. /*Get the front most window number*/
  505.     pascal short FirstWindowNumber(void);                        /*Window number of front most window            */
  506.  
  507. /*Get the Tool Bar's window number*/
  508.     pascal short ToolBarNumber(void);                            /*Tool Bar's window number                        */
  509.  
  510. /*Get the first floating Palette's window number*/
  511.     pascal short FirstPaletteNumber(void);                        /*Front most floating Palette's window number    */
  512.  
  513. /*Get the first standard window's number (not Tool Bar or Floating Palette).*/
  514.     pascal short FirstStdWindowNumber(void);                    /*Front most standard window's number            */
  515.  
  516. /*Get the working window number*/
  517.     pascal short WorkWindowNumber(void);                        /*Working window number                            */
  518.  
  519. /*Get the window number that contains the active editing field*/
  520.     pascal short EditFldWindowNumber(void);                        /*Window number containing active editing field    */
  521.  
  522. /*Determine if a window is open*/
  523.     pascal Boolean WindowIsOpen (short Window                    /*Window number                                    */
  524.                                     );                            /* = Is the window open?                        */
  525.  
  526. /*Determine if a window is visible (open and not hidden)*/
  527.     pascal Boolean WindowIsVisible (short Window                /*Window number                                    */
  528.                                       );                            /* = Is the window visible?                        */
  529.  
  530. /*Determine the type of window*/
  531.     pascal short WindowKind (short Window                        /*Window number                                    */
  532.                                        );                            /* = Kind of window                                */
  533.  
  534. /*Get a window's "window pointer" */
  535.     pascal WindowPtr WindowPointer (short Window                /*Window number                                    */
  536.                                     );                             /* = Window's pointer                            */
  537.  
  538.  
  539.  
  540. /*=============================================== B U T T O N S ===============================================    */
  541. /*Create a new button*/
  542.     pascal void NewButton (short Button,                        /*Button number                                    */
  543.                                     short left,                    /*Button's co-ordinates (local)                    */
  544.                                     short top,                    /*                                                */
  545.                                     short right,                /*                                                */
  546.                                     short bottom,                /*                                                */
  547.                                     Str255 Title,                /*Button's title                                */
  548.                                     short procID,                /*Button's definition ID                        */
  549.                                     Boolean EnabledFlag,        /*Enable the button?                            */
  550.                                     Boolean SelectedFlag);        /*Select the button?                            */
  551.  
  552. /*Create a new button (co-ordinates specified as a 'rect') */
  553.     pascal void NewButtonRect (short Button,                    /*Button number                                    */
  554.                                     Rect *Bounds,                /*Button's co-ordinates (local)                    */
  555.                                     Str255 Title,                /*Button's title                                */
  556.                                     short procID,                /*Button's definition ID                        */
  557.                                     Boolean EnabledFlag,        /*Enable the button?                            */
  558.                                     Boolean SelectedFlag);        /*Select the button?                            */
  559.  
  560. /*Delete a button*/
  561.     pascal void DeleteButton (short Button);                    /*Button number                                    */
  562.  
  563. /*Enable/disable a button*/
  564.     pascal void EnableButton (short Button,                        /*Button number                                    */
  565.                                     Boolean EnabledFlag);        /*Enable the button?                            */
  566.  
  567. /*Select/deselect a button*/
  568.     pascal void SelectButton (short Button,                        /*Button number                                    */
  569.                                     Boolean SelectedFlag);        /*Select the button?                            */
  570.  
  571. /*Determine if a button is enabled*/
  572.     pascal Boolean ButtonIsEnabled (short Button                /*Button number                                    */
  573.                                     );                            /* = Is the button enabled?                        */
  574.  
  575. /*Determine if a button is selected*/
  576.     pascal Boolean ButtonIsSelected (short Button                /*Button number                                    */
  577.                                     );                            /* = Is the button selected?                    */
  578.  
  579. /*Set a button's title*/
  580.     pascal void ButtonTitle (short Button,                        /*Button number                                    */
  581.                                     Str255 Title);                /*Button's title                                */
  582.  
  583. /*Make a button the window's default button*/
  584.     pascal void SetDefaultButton (short Button);                /*Button number                                    */
  585.  
  586. /*Remove the "default button status" from the window's default button*/
  587.     pascal void NoDefaultButton(void);
  588.  
  589. /*"Flash" a push button as though it were pressed by the user*/
  590.     pascal void FlashButton (short Button);                        /*Button number                                    */
  591.  
  592.  
  593.  
  594. /*======================================= P I C T U R E   B U T T O N S ======================================    */
  595. /*Create a new Picture Button*/
  596.     pascal void NewPictButton (short Button,                    /*Picture button number                            */
  597.                                     short left,                    /*Button's top-left corner in window's local    */
  598.                                     short top,                    /*    co-ordinates.                                */
  599.                                     short BaseID,                /*Base image's ID number                        */
  600.                                     long procID,                /*Appearance and Behavior specifications        */
  601.                                     Boolean EnabledFlag,        /*"Button is enabled" flag                        */
  602.                                     Boolean SelectedFlag,        /*"Button is selected" flag                        */
  603.                                     short minimum,                /*Minimum limit of button's value                */
  604.                                     short value,                /*Button's value                                */
  605.                                     short maximum);                /*Maximum limit of button's value                */
  606.  
  607. /*Delete a picture button*/
  608.     pascal void DeletePictButton (short Button);                /*Picture button number                            */
  609.  
  610. /*Enable/disable a picture button*/
  611.     pascal void EnablePictButton (short Button,                    /*Picture button number                            */
  612.                                     Boolean EnabledFlag);        /*Enable the picture button?                    */
  613.  
  614. /*Select/deselect a picture button*/
  615.     pascal void SelectPictButton (short Button,                    /*Picture button number                            */
  616.                                     Boolean SelectedFlag);        /*Select the picture button?                    */
  617.  
  618. /*Get a picture button's minimum setting*/
  619.     pascal short GetPictButtonMin (short Button                    /*Picture button number                            */
  620.                                     );                            /* = Picture button's minimum setting            */
  621.  
  622. /*Set a picture button's minimum setting*/
  623.     pascal void SetPictButtonMin (short Button,                    /*Picture button number                            */
  624.                                     short minimum);                /*Picture button's minimum setting                */
  625.  
  626. /*Get a picture button's maximum setting*/
  627.     pascal short GetPictButtonMax (short Button                    /*Picture button number                            */
  628.                                     );                            /* = Picture button's maximum setting            */
  629.  
  630. /*Set a picture button's maximum setting*/
  631.     pascal void SetPictButtonMax (short Button,                    /*Picture button number                            */
  632.                                     short maximum);                /* = Picture button's maximum setting            */
  633.  
  634. /*Get a picture button's current value*/
  635.     pascal short GetPictButtonVal (short Button                    /*Picture button number                            */
  636.                                     );                            /* = Picture button's current value                */
  637.  
  638. /*Set a picture button's current value*/
  639.     pascal void SetPictButtonVal (short Button,                    /*Picture button number                            */
  640.                                     short value);                /*Picture button's value                        */
  641.  
  642. /*Set a picture button's current value, and simultaneously select/deselect it*/
  643.     pascal void SetPictButtonValSelect (short Button,            /*Picture button number                            */
  644.                                     short value,                /*Picture button's value                        */
  645.                                     Boolean SelectedFlag);        /*Select the picture button?                    */
  646.  
  647. /*Set a picture button's value acceleration 'automatic value changing'*/
  648.     pascal void SetPictButtonAccel (short Button,                /*Picture button number                            */
  649.                                     short Rate);                /*0 = Linear, 1-3 = Slow to fast acceleration    */
  650.  
  651. /*Set a picture button's speed for 'automatic value changing'*/
  652.     pascal void SetPictButtonSpeed (short Button,                /*Picture button number                            */
  653.                                     short Rate);                /*Rate of change (value increment per second)    */
  654.  
  655. /*Determine if a picture button is enabled*/
  656.     pascal Boolean PictButtonIsEnabled (short Button            /*Picture button number                            */
  657.                                     );                            /* = Is the button enabled?                        */
  658.  
  659. /*Determine if a picture button is selected*/
  660.     pascal Boolean PictButtonIsSelected (short Button            /*Picture button number                            */
  661.                                     );                            /* = Is the button selected?                    */
  662.  
  663. /*"Flash" a picture button as though it were pressed by the user*/
  664.     pascal void FlashPictButton (short Button);                    /*Picture button number                            */
  665.  
  666.  
  667.  
  668.  
  669. /*=========================================== S C R O L L   B A R S ===========================================    */
  670. /*Create a new scroll bar*/
  671.     pascal void NewScrollBar (short ScrollBar,                    /*Scroll bar number                                */
  672.                                     short left,                    /*Scroll bar's co-ordinates (local)                */
  673.                                     short top,                    /*                                                */
  674.                                     short right,                 /*                                                */
  675.                                     short bottom,                /*                                                */
  676.                                     Boolean EnabledFlag,        /*Enable the scroll bar?                        */
  677.                                     short minimum,                /*Minimum, current, and maximum value            */
  678.                                     short value,                /*                                                */
  679.                                     short maximum);                /*                                                */
  680.  
  681. /*Create a new scroll bar (co-ordinates specified as a 'rect') */
  682.     pascal void NewScrollBarRect (short ScrollBar,                /*Scroll bar number                                */
  683.                                     Rect *Bounds,                /*Scroll bar's co-ordinates (local)                */
  684.                                     Boolean EnabledFlag,        /*Enable the scroll bar?                        */
  685.                                     short minimum,                /*Minimum, current, and maximum value            */
  686.                                     short value,                /*                                                */
  687.                                     short maximum);                /*                                                */
  688.  
  689. /*Delete a scroll bar*/
  690.     pascal void DeleteScrollBar (short ScrollBar);                /*Scroll bar number                                */
  691.  
  692. /*Enable/disable a scroll bar*/
  693.     pascal void EnableScrollBar (short ScrollBar,                /*Scroll bar number                                */
  694.                                     Boolean EnabledFlag);        /*Enable the scroll bar?                        */
  695.  
  696. /*Get a scroll bar's minimum setting*/
  697.     pascal short GetScrollBarMin (short ScrollBar                /*Scroll bar number                                */
  698.                                     );                            /*Scroll bar's minimum setting                    */
  699.  
  700. /*Set a scroll bar's minimum setting*/
  701.     pascal void SetScrollBarMin (short ScrollBar,                /*Scroll bar number                                */
  702.                                     short minimum);                /*Scroll bar's minimum setting                    */
  703.  
  704. /*Get a scroll bar's maximum setting*/
  705.     pascal short GetScrollBarMax (short ScrollBar                /*Scroll bar number                                */
  706.                                     );                            /* = Scroll bar's maximum setting                */
  707.  
  708. /*Set a scroll bar's maximum setting*/
  709.     pascal void SetScrollBarMax (short ScrollBar,                /*Scroll bar number                                */
  710.                                     short maximum);                /*Scroll bar's maximum setting                    */
  711.  
  712. /*Get a scroll bar's current value*/
  713.     pascal short GetScrollBarVal (short ScrollBar                /*Scroll bar number                                */
  714.                                     );                             /* = Scroll bar's current value                    */
  715.  
  716. /*Set a scroll bar's current value*/
  717.     pascal void SetScrollBarVal (short ScrollBar,                /*Scroll bar number                                */
  718.                                     short value);                /*Scroll bar's current value                    */
  719.  
  720.  
  721.  
  722. /*======================================== E D I T I N G   F I E L D S ========================================    */
  723. /*Create a new field*/
  724.     pascal void NewField (short Field,                            /*Field number                                    */
  725.                                     short left,                 /*Field's viewing area co-ordinates (local)        */
  726.                                     short top,                    /*                                                */
  727.                                     short right,                /*                                                */
  728.                                     short bottom,                /*                                                */
  729.                                     Handle hStr,                /*Handle to edit field's text                    */
  730.                                     short teType,                /*Type: box around field and/or CR allowed?        */
  731.                                     short Just);                /*Justification: left, centre, right                */
  732.  
  733. /*Create a new field (co-ordinates specified as a 'rect') */
  734.     pascal void NewFieldRect (short Field,                        /*Field number                                    */
  735.                                     Rect *Bounds,                 /*Field's viewing area co-ordinates (local)        */
  736.                                     Handle hStr,                /*Handle to edit field's text                    */
  737.                                     short teType,                /*Type: box around field and/or CR allowed?        */
  738.                                     short Just);                /*Justification: left, centre, right            */
  739.  
  740. /*Delete a field*/
  741.     pascal void DeleteField (short Field);                        /*Field number                                    */
  742.  
  743. /*Activate a  field*/
  744.     pascal void ActivateField (short Field,                        /*Field number                                    */
  745.                                     short Selection);            /*Text selection: all, start, end                */
  746.  
  747. /*Deactivate the active field*/
  748.     pascal void DeactivateField(void);
  749.  
  750. /*Process a mouse click in an inactive field.  The click has been detected by the PollSystem routine.*/
  751.     pascal void ClickInField(void);
  752.  
  753. /*Get the active field's edited text*/
  754.     pascal void GetFieldString (Str255 *EditString);            /*Field's edited text                            */
  755.  
  756. /*Save the active field's edited text in the field's string*/
  757.     pascal void SaveFieldString(void);
  758.  
  759. /*Determine the active field number*/
  760.     pascal short ActiveFieldNumber(void);                        /*Active field number                            */
  761.  
  762. /*Turn string length limiting on/off for each new field created starting now*/
  763.     pascal void FieldLengthLimit (Boolean Limits);                /*Should newly created fields be length-limited?*/
  764.  
  765. /*Offset a field*/
  766.     pascal void OffsetField (short Field,                        /*Field number                                    */
  767.                                     short dh, short dv);        /*Number of pixels to be offset (horiz/vert)    */
  768.  
  769. /*Paste text into a field*/
  770.     pascal void PasteIntoField (short Field,                    /*Field number                                    */
  771.                                     Str255 Text,                /*Text which is to be pasted                    */
  772.                                     Boolean Replace);            /*Replace all existing text in field?            */
  773.  
  774.  
  775.  
  776. /*============================================ L I S T   B O X E S ============================================    */
  777. /*Create a new List Box*/
  778.     pascal void NewListBox (short ListBox,                        /*List box number                                */
  779.                                     short left,                    /*List box co-ordinates (local)                    */
  780.                                     short top,                    /*                                                */
  781.                                     short right,                /*                                                */
  782.                                     short bottom,                /*                                                */                        
  783.                                     SignedByte BoxType);        /*Type of responses to mouse clicks, shift-        */
  784.                                                                 /*    click, dragging, etc.                        */
  785.  
  786. /*Create a new List Box (co-ordinates specified as a 'rect') */
  787.     pascal void NewListBoxRect (short ListBox,                    /*List box number                                */
  788.                                     Rect *Bounds,                /*List box co-ordinates (local)                    */
  789.                                     SignedByte BoxType);        /*Type of responses to mouse clicks, shift-        */
  790.                                                                 /*    click, dragging, etc.                        */
  791.  
  792. /*Delete a List Box*/
  793.     pascal void DeleteListBox (short ListBox);                    /*List box number                                */
  794.  
  795. /*Set a line of text in a List Box*/
  796.     pascal void SetListBoxText (short ListBox,                    /*List box number                                */
  797.                                     short LineNum,                /*Line number                                    */
  798.                                     Str255 Text);                /*Text of specified line number                    */
  799.  
  800. /*Get a line of text from a List Box*/
  801.     pascal void GetListBoxText (short ListBox,                    /*List box number                                */
  802.                                     short LineNum,                /*Line number                                    */
  803.                                     Str255 *Text);                /*Text of specified line number                    */
  804.  
  805. /*Get a List Box's line number whose text is greater than or equal to the specified string*/
  806.     pascal short SearchListBox (short ListBox,                    /*List box number                                */
  807.                                     Str255 Text                    /*Text being compared                            */
  808.                                     );                            /* = Line number of text                        */
  809.  
  810. /*Select/deselect a specified List Box line*/
  811.     pascal void SetListBoxLine (short ListBox,                    /*List box number                                */
  812.                                     short LineNum,                /*Line number                                    */
  813.                                     Boolean SetIt);                /*Selects the line?                                */
  814.  
  815. /*Determine if a specific List Box line is selected*/
  816.     pascal Boolean GetListBoxLine (short ListBox,                /*List box number                                */
  817.                                     short LineNum                /*Line number                                    */
  818.                                     );                            /* = Is the line selected?                        */
  819.  
  820. /*Get the line number of a selected line in a List Box, starting at LineNum and searching down*/
  821.     pascal short GetListBoxLines (short ListBox,                /*List box number                                */
  822.                                     short LineNum                /*Line number                                    */
  823.                                     );                            /* = Next selected line                            */
  824.  
  825. /*Insert a blank line into a List Box*/
  826.     pascal void InsertListBoxLine (short ListBox,                /*List box number                                */
  827.                                     short LineNum);                /*Line number                                    */
  828.  
  829. /*Delete a line from a List Box*/
  830.     pascal void DeleteListBoxLine (short ListBox,                /*List box number                                */
  831.                                     short LineNum);                /*Line number                                    */
  832.  
  833. /*Turn a List Box's text drawing on/off*/
  834.     pascal void DrawListBox (short ListBox,                        /*List box number                                */
  835.                                     Boolean DrawIt);            /*Draw the list box's text?                        */
  836.  
  837.  
  838.  
  839. /*================================================= M E N U S =================================================    */
  840. /*Create the "Apple" menu*/
  841.     pascal void AppleMenu (Str255 AboutName);                    /*Optional "About…" name                        */
  842.  
  843. /*Create a menu name, add/change a menu item, or rename an existing menu item*/
  844.     pascal void Menu (short MenuNumber,                            /*Menu number                                    */
  845.                                     short ItemNumber,            /*Item number within the menu                    */
  846.                                     Boolean EnabledFlag,        /*Enable the menu?                                */
  847.                                     Str255 MenuText);            /*Menu title or item name                        */
  848.  
  849. /*Attach a hierarchical menu to a menu item, or detach a hierarchical menu*/
  850.     pascal void AttachMenu (short MenuNumber,                    /*Menu number to which the submenu is attached    */
  851.                                     short ItemNumber,            /*Item number to which the submenu is attached    */
  852.                                     short SubMenuNumber);        /*Hierarchical menu number being attached        */
  853.  
  854. /*Insert a menu item*/
  855.     pascal void InsertMenuitem (short MenuNumber,                /*Menu number                                    */
  856.                                     short ItemNumber,            /*Item number where insertion is to be made        */
  857.                                     Boolean EnabledFlag,        /*Enable the menu?                                */
  858.                                     Str255 MenuText);            /*Item name                                        */
  859.  
  860. /*Remove an entire menu and its associated items, or a menu item*/
  861.     pascal void RemoveMenu (short MenuNumber,                    /*Menu number                                    */
  862.                                     short ItemNumber);            /*Item number within the menu (0=entire menu)    */
  863.  
  864. /*Display the menu bar after making changes through the Menu or RemoveMenu procedure*/
  865.     pascal void UpdateMenuBar(void);
  866.  
  867. /*Get a menu item's text*/
  868.     pascal void GetMenuString (short MenuNumber,                /*Menu number                                    */
  869.                                     short ItemNumber,            /*Item number within the menu                    */
  870.                                     Str255 *MenuText);            /*Menu item's name                                */
  871.  
  872. /*Change the name of a menu item*/
  873.     pascal void RenameItem (short MenuNumber,                    /*Menu number                                    */
  874.                                     short ItemNumber,            /*Item number within the menu                    */
  875.                                     Str255 MenuText);            /*Menu item's name                                */
  876.  
  877. /*Enable/disable a menu or menu item*/
  878.     pascal void EnableMenu (short MenuNumber,                    /*Menu number                                    */
  879.                                     short ItemNumber,            /*Item number within the menu (or 0)            */
  880.                                     Boolean EnabledFlag);        /*Enable the menu or item?                        */
  881.  
  882. /*Display/remove a menu item's check mark*/
  883.     pascal void CheckMenu (short MenuNumber,                    /*Menu number                                    */
  884.                                     short ItemNumber,            /*Item number within the menu                    */
  885.                                     Boolean checked);            /*Place check mark beside the menu item?        */
  886.  
  887. /*Mark a menu item with a specified character (√ or •, etc)*/
  888.     pascal void MenuMark (short MenuNumber,                        /*Menu number                                    */
  889.                                     short ItemNumber,            /*Item number within the menu                    */
  890.                                     char markChar);                /*Menu item's character                            */
  891.  
  892. /*Get a menu item's ‘mark’ character (√ or •, etc) which is optionally displayed at the item's left side*/
  893.     pascal void GetMenuMark (short MenuNumber,                    /*Menu number                                    */
  894.                                     short ItemNumber,            /*Item number within the menu                    */
  895.                                     char *markChar);            /*Menu item's character                            */
  896.  
  897. /*Specify a keyboard equivalent for a menu item*/
  898.     pascal void MenuCmd (short MenuNumber,                        /*Menu number                                    */
  899.                                     short ItemNumber,            /*Item number within the menu                    */
  900.                                     char cmdChar);                /*Menu item's keyboard-equivalent character        */
  901.  
  902. /*Get a keyboard equivalent for a menu item*/
  903.     pascal void GetMenuCmd (short MenuNumber,                    /*Menu number                                    */
  904.                                     short ItemNumber,            /*Item number within the menu                    */
  905.                                     char *cmdChar);                /*Menu item's keyboard-equivalent character        */
  906.  
  907. /*Specify an icon to be displayed by a menu item*/
  908.     pascal void MenuIcon (short MenuNumber,                        /*Menu number                                    */
  909.                                     short ItemNumber,            /*Item number within the menu                    */
  910.                                     short IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  911.  
  912. /*Get the specifier for the icon that is displayed by a menu item*/
  913.     pascal void GetMenuIcon (short MenuNumber,                    /*Menu number                                    */
  914.                                     short ItemNumber,            /*Item number within the menu                    */
  915.                                     short *IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  916.  
  917. /*Set the character style for a menu item*/
  918.     pascal void MenuStyle (short MenuNumber,                    /*Menu number                                    */
  919.                                     short ItemNumber,            /*Item number within the menu                    */
  920.                                     Style theStyle);            /*Menu item's character style                    */
  921.  
  922. /*Determine the number of items in a menu*/
  923.     pascal short MenuItemCount (short MenuNumber                /*Menu number                                    */
  924.                                        );                            /* =Number of items in the menu                    */
  925.  
  926. /*Determine a menu's parent menu number*/
  927.      pascal void GetParentMenu (short *MenuNumber,                /*Parent menu's menu number                        */
  928.                                     short *ItemNumber,            /*Parent menu's item number                     */
  929.                                     short SubMenuNumber);        /*Menu number whose parent menu is determined    */
  930.  
  931. /*Determine a menu item's submenu number*/
  932.      pascal void GetSubMenu (short MenuNumber,                    /*Menu number                                    */
  933.                                     short ItemNumber,            /*Item number within the menu                    */
  934.                                     short *SubMenuNumber);        /*Menu number of this item's submenu            */
  935.  
  936. /*Highlight a menu in the menu bar, or turn off menu bar highlights*/
  937.     pascal void MenuHilite (short MenuNumber);                    /*Menu number                                    */
  938.  
  939.  
  940.  
  941. /*========================================== P O P - U P   M E N U S ==========================================    */
  942. /*Create a new Pop-Up menu*/
  943.     pascal void NewPopUp (short MenuNumber,                        /*Pop-Up Menu number                            */
  944.                                     short left,                    /*Enclosing rectangle co-ordinates (local)        */
  945.                                     short top,                    /*                                                */
  946.                                     short right,                /*                                                */
  947.                                     short bottom,                /*                                                */
  948.                                     Str255 MenuTitle,            /*Title                                            */
  949.                                     short procID,                /*Appearance and behavior specifications        */
  950.                                     Boolean EnabledFlag);        /*"Menu is enabled" flag                        */
  951.  
  952. /*Create a new Pop-Up menu (co-ordinates specified as a 'rect') */
  953.     pascal void NewPopUpRect (short MenuNumber,                    /*Pop-Up Menu number                            */
  954.                                     Rect *Bounds,                /*Enclosing rectangle co-ordinates (local)        */
  955.                                     Str255 Title,                /*Title                                            */
  956.                                     short procID,                /*Appearance and behavior specifications        */
  957.                                     Boolean EnabledFlag);        /*"Menu is enabled" flag                        */
  958.  
  959. /*Add or change a Pop-Up menu item, or rename an existing menu item*/
  960.     pascal void PopUpMenu (short MenuNumber,                    /*Pop-Up Menu number                            */
  961.                                     short ItemNumber,            /*Item number within the menu                    */
  962.                                     Boolean EnabledFlag,        /*Enable the menu?                                */
  963.                                     Str255 MenuText);            /*Item name                                        */
  964.  
  965. /*Insert a Pop-Up menu item in the "current" window*/
  966.     pascal void InsertPopUpItem (short MenuNumber,                /*Pop-Up Menu number                            */
  967.                                     short ItemNumber,            /*Item number where insertion is to be made        */
  968.                                     Boolean EnabledFlag,        /*Is menu item enabled?                            */
  969.                                     Str255 MenuText);            /*Item name                                        */
  970.  
  971. /*Remove an Pop-Up menu, or a Pop-Up menu item*/
  972.     pascal void RemovePopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  973.                                     short ItemNumber);            /*Item number within the menu (0=entire menu)    */
  974.  
  975. /*Get an Pop-Up Menu item's text*/
  976.     pascal void GetPopUpString (short MenuNumber,                /*Pop-Up Menu number                            */
  977.                                     short ItemNumber,            /*Item number within the menu                    */
  978.                                     Str255 *MenuText);            /*Menu item's name                                */
  979.  
  980. /*Change the name of a Pop-Up Menu item*/
  981.     pascal void RenamePopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  982.                                     short ItemNumber,            /*Item number within the menu                    */
  983.                                     Str255 MenuText);            /*Menu item's name                                */
  984.  
  985. /*Enable/disable a Pop-Up Menu or menu item*/
  986.     pascal void EnablePopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  987.                                     short ItemNumber,            /*Item number within the menu (or 0)            */
  988.                                     Boolean EnabledFlag);        /*Enable the menu or item?                        */
  989.  
  990. /*Determine if a Pop-Up Menu is enabled*/
  991.     pascal Boolean PopUpIsEnabled (short MenuNumber                /*Pop-Up Menu number                            */
  992.                                     );                            /* = Is the menu enabled?                        */
  993.  
  994. /*Display/remove a Pop-Up Menu item's check mark*/
  995.     pascal void CheckPopUp (short MenuNumber,                    /*Pop-Up Menu number                            */
  996.                                     short ItemNumber,            /*Item number within the menu                    */
  997.                                     Boolean checked);            /*Place check mark beside the menu item?        */
  998.  
  999. /*Mark a Pop-Up Menu item with a specified character (√ or •, etc)*/
  1000.     pascal void PopUpMark (short MenuNumber,                    /*Pop-Up Menu number                            */
  1001.                                     short ItemNumber,            /*Item number within the menu                    */
  1002.                                     char markChar);                /*Menu item's character                            */
  1003.  
  1004. /*Get a Pop-Up Menu item's ‘mark’ character (√ or •, etc) which is optionally displayed at the item's left side*/
  1005.     pascal void GetPopUpMark (short MenuNumber,                    /*Pop-Up Menu number                            */
  1006.                                     short ItemNumber,            /*Item number within the menu                    */
  1007.                                     char *markChar);            /*Menu item's character                            */
  1008.  
  1009. /*Specify an icon to be displayed by a Pop-Up Menu item*/
  1010.     pascal void PopUpIcon (short MenuNumber,                    /*Pop-Up Menu number                            */
  1011.                                     short ItemNumber,            /*Item number within the menu                    */
  1012.                                     short IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  1013.  
  1014. /*Get the specifier for the icon that is displayed by a Pop-Up Menu item*/
  1015.     pascal void GetPopUpIcon (short MenuNumber,                    /*Pop-Up Menu number                            */
  1016.                                     short ItemNumber,            /*Item number within the menu                    */
  1017.                                     short *IconSelector);        /*IconSelector + 256 = cicn or ICON ID            */
  1018.  
  1019. /*Set the character style for a Pop-Up Menu item*/
  1020.     pascal void PopUpStyle (short MenuNumber,                    /*Pop-Up Menu number                            */
  1021.                                     short ItemNumber,            /*Item number within the menu                    */
  1022.                                     Style theStyle);            /*Menu item's character style                    */
  1023.  
  1024. /*Determine the number of items in a Pop-Up Menu*/
  1025.     pascal short PopUpItemCount (short MenuNumber                /*Pop-Up Menu number                            */
  1026.                                     );                            /* = Number of items in the menu                */
  1027.  
  1028. /*Determine the selected item in a Pop-Up Menu*/
  1029.     pascal short GetPopUpSelection (short MenuNumber            /*Pop-Up Menu number                            */
  1030.                                     );                            /*Selected item in the menu                        */
  1031.  
  1032.  
  1033.  
  1034. /*=============================================== C U R S O R S ===============================================    */
  1035. /*Change the cursor shape*/
  1036.     pascal void CursorShape (short CursorType);                 /*Cursor type                                    */
  1037.  
  1038. /*Reset the cursor to its appropriate shape depending on its location in the active window.*/
  1039.     pascal void ResetCursor(void);
  1040.  
  1041. /*Create a new Cursor Table*/
  1042.     pascal void NewCursorTable (short CursorTable,                /*Cursor table number                            */
  1043.                                     short CursorType);            /*Cursor type                                    */
  1044.  
  1045. /*Delete a Cursor Table*/
  1046.     pascal void DeleteCursorTable (short CursorTable);            /*Cursor table number                            */
  1047.  
  1048. /*Add a new Cursor Zone to a Cursor Table, or replace an existing Cursor Zone*/
  1049.     pascal void CursorZone (short CursorTable,                    /*Cursor table number                            */
  1050.                                     short CursorZone,            /*Cursor zone number                            */
  1051.                                     short CursorType,            /*Cursor type                                    */
  1052.                                     short left,                    /*Cursor zone's co-ordinates (local)            */
  1053.                                     short top,                    /*                                                */
  1054.                                     short right,                /*                                                */
  1055.                                     short bottom);                /*                                                */                        
  1056.  
  1057. /*Add a new Cursor Zone to a Cursor Table, or replace an existing Cursor Zone (co-ordinates specified as a 'rect') */
  1058.     pascal void CursorZoneRect (short CursorTable,                /*Cursor table number                            */
  1059.                                     short CursorZone,            /*Cursor zone number                            */
  1060.                                     short CursorType,            /*Cursor type                                    */
  1061.                                     Rect *Bounds);                /*Cursor zone's co-ordinates (local)            */
  1062.  
  1063. /*Add a new Cursor Zone to a Cursor Table, or replace an existing Cursor Zone (co-ordinates specified as a 'region') */
  1064.     pascal void CursorZoneRgn (short CursorTable,                /*Cursor table number                            */
  1065.                                     short CursorZone,            /*Cursor zone number                            */
  1066.                                     short CursorType,            /*Cursor type                                    */
  1067.                                     RgnHandle ZoneRgn);            /*Cursor zone's region (local)                    */
  1068.  
  1069. /*Indicate that the cursor shape may have to be recalculated due to manually altering Cursor Zone regions.        */
  1070.     pascal void ChangedCursorZone(void);
  1071.  
  1072. /*Delete a Cursor Zone*/
  1073.     pascal void DeleteCursorZone (short CursorTable,            /*Cursor table number                            */
  1074.                                     short CursorZone);            /*Cursor zone number                            */
  1075.  
  1076. /*Get the co-ordinates of a specified Cursor Zone*/
  1077.     pascal void GetCursorZone (short CursorTable,                /*Cursor table number                            */
  1078.                                     short CursorZone,            /*Cursor zone number                            */
  1079.                                     Rect *Bounds);                /*Cursor zone's co-ordinates (local)            */
  1080.  
  1081. /*Get a Cursor Zone's region*/
  1082.     pascal RgnHandle GetCursorZoneRgn (short CursorTable,        /*Cursor table number                            */
  1083.                                        short CursorZone            /*Cursor zone number                            */
  1084.                                        );                            /* = Handle to Cursor region (local)            */
  1085.  
  1086. /*Make the current window use a specified Cursor Table*/
  1087.     pascal void UseCursorTable (short CursorTable);                /*Cursor table number                            */
  1088.  
  1089. /*Find the cursor zone that contains a specified point*/
  1090.     pascal short FindCursorZone (Point thePoint                    /*Location in window's local co-ordinates        */
  1091.                                     );                            /* = Cursor zone number containing the point    */
  1092.  
  1093. /*Enable/disable clicks on push-buttons when the watchCursor is displayed*/
  1094.     pascal void WatchCursorButtons (Boolean Allowed);            /*Can push-buttons be clicked when the            */
  1095.                                                                 /*    watchCursor is displayed?                    */
  1096.  
  1097.  
  1098.  
  1099. /*=============================================== P O L L I N G ===============================================    */
  1100. /*Tools Plus polling procedure*/
  1101.     pascal Boolean PollSystem (TPPollRecord *Poll                /*Polling record                                */
  1102.                                     );                            /* = Did an event occurred?                        */
  1103.  
  1104. /*Set the number of ticks (1/60 sec) your application can wait until it receives a doNothing event.*/
  1105.     pascal void SetNullTime (long ForegroundTime,                /*Duration when application is active            */
  1106.                                        long BackgroundTime);        /*Duration when application is suspended        */
  1107.  
  1108. /*Determine if "waiting for doNothing events" (timed doNothing events) is supported.*/
  1109.     pascal Boolean WaitAvail(void);                                /*Is waiting between doNothing events supported?*/
  1110.  
  1111. /*Determine if the application is 'suspended' (ie: this is not the active application)*/
  1112.     pascal Boolean ApplicationSuspended(void);                    /*Is the application suspended?                    */
  1113.  
  1114. /*Clear the mouse's current click or drag (ie: discontinue the process, clear the event*/
  1115.     pascal void ResetMouseClicks(void);
  1116.  
  1117.  
  1118.  
  1119. /*========================================= C O L O R   D R A W I N G =========================================    */
  1120. /*Determine if the Macintosh has color QuickDraw*/
  1121.     pascal Boolean HasColorQuickDraw(void);                        /*Does the Mac have color QuickDraw                */
  1122.  
  1123. /*Determine the number of logical screens (distinct screen depth and color/gray settings)*/
  1124.     pascal short NumberOfScreens(void);                            /*Number of logical screens available            */
  1125.  
  1126. /*Begin updating the specified logical screen*/
  1127.     pascal void BeginUpdateScreen (short TheScreen);            /*Logical screen number                            */
  1128.  
  1129. /*End updating the most recent logical screen*/
  1130.     pascal void EndUpdateScreen(void);
  1131.  
  1132. /*Determine the logical screen's depth*/
  1133.     pascal short ScreenDepth(void);                                /*Screen depth in bits                            */
  1134.  
  1135. /*Determine if the logical screen is set to display in color*/
  1136.     pascal Boolean ScreenHasColors(void);                        /*Is the screen set to display in color?        */
  1137.  
  1138. /*Color equivalent to 'PenNormal' routine*/
  1139.     pascal void PenColorNormal(void);
  1140.  
  1141. /*Color equivalent to 'GetPenState' routine*/
  1142.     pascal void GetColorPenState (ColorPenState *ThePenState);
  1143.  
  1144. /*Color equivalent to 'SetPenState' routine*/
  1145.     pascal void SetColorPenState (ColorPenState *ThePenState);
  1146.  
  1147.  
  1148.  
  1149. /*===================================== U S E R    N O T I F I C A T I O N ====================================    */
  1150. /*Define the settings for notifying the user.*/
  1151.     pascal void SetNotification (short IconID,                    /*'SICN' icon ID displayed during notification    */
  1152.                                     short SoundID,                /*Sound ID that is played at notification        */
  1153.                                     Str255 Message,                /*Message displayed during notification            */
  1154.                                     Boolean ResetAfterUse);        /*Revert settings to defaults after notification*/
  1155.  
  1156. /*If this application is inactive, inform user that this application needs attention.*/
  1157.     pascal Boolean PostNotification(void);                        /*Was the user notified?                        */
  1158.  
  1159.  
  1160.  
  1161. /*========================================= M I S C E L L A N E O U S =========================================    */
  1162. /*Determine the System file version*/
  1163.     pascal double SystemVersion(void);                            /*System file version (eg 7.0.1 seen as 7.01)    */
  1164.  
  1165. /*Draw an icon (ICON, ICN#, icl8, icl4, and cicn)*/
  1166.     pascal void DrawIcon (short theIcon,                        /*Icon ID number                                */
  1167.                                     short left,                    /*Icon's top-left corner (local)                */
  1168.                                     short top,                    /*                                                */
  1169.                                     Boolean EnabledFlag,        /*Enable the icon?                                */
  1170.                                     Boolean SelectedFlag);        /*Select the icon?                                */
  1171.  
  1172. /*Specify the default appearance for disabled icons*/
  1173.     pascal void DefaultIconLook (short IconSpec);                /*Appearance specifications                        */
  1174.  
  1175. /*Draw a standard Macintosh progress thermometer*/
  1176.     pascal void DrawThermometer (Rect *DisplayRect,                /*Thermometer's co-ordinates (local)            */
  1177.                                     float Percent);                /*Percent complete (ie: .5 means 50%)            */
  1178.  
  1179. /*Display a dynamic Alert Box and return the use's action*/
  1180.     pascal short AlertBox (short theIcon,                        /*Icon ID number                                */
  1181.                                     Str255 AlertText,            /*Alert's text                                    */
  1182.                                     long AlertCode                /*Button setup codes                            */
  1183.                                     );                            /* = Button clicked by user                        */
  1184.  
  1185. /*Change a button name for the next use of the dynamic Alert Box*/
  1186.     pascal void AlertButtonName (short Button,                    /*Button number from 1 to 9                        */
  1187.                                     Str255 Title);                /*Button's title                                */
  1188.  
  1189. /*Draw "zoom" lines (expanding/collapsing rectangle)*/
  1190.     pascal void ZoomLines (Rect *OldRect,                        /*Starting rectangle (global co-ordinates)        */
  1191.                                     Rect *NewRect,                /*Ending rectangle (global co-ordinates)        */
  1192.                                     short Zoom);                /*Zoom across, in, or out                        */
  1193.  
  1194. /*Play the System Error sound*/
  1195.     pascal void Beep(void);
  1196.  
  1197. /*Wait for a specified duration*/
  1198.     pascal void Wait (short ClockTicks);                        /*Number of ticks (1/60th sec) to wait            */
  1199.  
  1200. /*Determine the minimum value of 2 numbers*/
  1201.     pascal long min (long Val1, long Val2);
  1202.  
  1203. /*Determine the maximum value of 2 numbers*/
  1204.     pascal long max (long Val1, long Val2);
  1205.  
  1206.  
  1207.  
  1208.  
  1209.  
  1210. #ifdef __cplusplus
  1211. }
  1212. #endif
  1213. #endif /* __ToolsPlus__ */
  1214.